from mailsnake import MailSnake
from django.conf import settings

def sendMail(template, dest_user_name, from_email, to_email, vars_map):
	mapi = MailSnake(settings.MANDRILL_API_KEY, api='mandrill')
	mapi.messages.send_template(track_opens=True,
			  template_name=template,
			  template_content=[{'name':'username', "content": dest_user_name}],
			  message={
			  	  'subject':'Welcome to CashG %s' % (dest_user_name),
				  'from_email':from_email,
				  'from_name':'Welcome to CashG',
				  'to':[{'email':to_email, 'name': dest_user_name}],
				  'global_merge_vars': [vars_map]}
			  )
